import service from '@/utils/request'

export const useDictionariesApi = (id: number) => {
	return service.get('/nb/business/dictionaries/findById', { params: { id: id } })
}

export const useDictionariesSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.post('/nb/business/dictionaries/edit', dataForm)
	} else {
		return service.post('/nb/business/dictionaries/add', dataForm)
	}
}

export const findByCode = (code: string) => {
	return service.get('/nb/business/dictionaries/findByCode', { params: { code: code } })
}